package business
{
	import com.adobe.cairngorm.business.ServiceLocator;
	
	import mx.collections.ItemResponder;
	import mx.rpc.AsyncToken;
	import mx.rpc.remoting.RemoteObject;
	
	public class ApplyClassDelegate
	{
		private var responder:Object;
        private var service:RemoteObject;			
		
		public function ApplyClassDelegate(re:Object)
		{
	        this.service = ServiceLocator.getInstance().getRemoteObject("applyClassService");
            this.responder = re;			
		}
		
        public function getDataByPage(page:int, type:String, status:String):void
        {
            var token:AsyncToken;
            var itemResponder:ItemResponder;
            token = service.getDataByPage(page, type, status);
            itemResponder = new ItemResponder(responder["getDataResult"],responder["fault"] );
            token.addResponder(itemResponder);
        }
        
        public function setStatus(id:String, type:String, status:String, rejectInfo:String, bPass:int, titleori:String, titlebak:String, adwordsbak:String, catalogbak:String):void
        {		
            var token:AsyncToken;
            var itemResponder:ItemResponder;
            token = service.setStatus(id, type, status, rejectInfo, bPass, titleori, titlebak, adwordsbak, catalogbak);
            itemResponder = new ItemResponder(responder["setStatusResult"],responder["fault"] );
            token.addResponder(itemResponder);        		
        }
        
        public function getDataBySearch(obj:Object, page:int=0):void
        {
            var token:AsyncToken;
            var itemResponder:ItemResponder;
            token = service.getDataBySearch(obj, page);
            itemResponder = new ItemResponder(responder["getDataResult"],responder["fault"] );
            token.addResponder(itemResponder);             	
        }
        
        public function delData( id:String, type:String, msg:String ):void
        {
            var token:AsyncToken;
            var itemResponder:ItemResponder;
            token = service.delData(id, type, msg);
            itemResponder = new ItemResponder(responder["delDataResult"],responder["fault"] );
            token.addResponder(itemResponder);            	
        }
        
        public function getWords():void
        {
            var token:AsyncToken;
            var itemResponder:ItemResponder;
            token = service.getWords();
            itemResponder = new ItemResponder(responder["getWordsResult"],responder["fault"] );
            token.addResponder(itemResponder);        	
        }         

	}
}